<?php
	echo '<p>Initializing...</p>';
	
	// Retrieve POST vars
    $name = $_POST['name'];
    $email = $_POST['email'];
    $message = stripslashes($_POST['message']);
	
	echo '<p>POST vars retrieved...</p>';
	
    // Set up email params
	$headers  = "From: \"ClaimEverything.com\" <info@claimeverything.com> \r\n";
	$headers .= "Reply-To: info@claimeverything.com \r\n";
	$headers .= "Return-Path: info@claimeverything.com \r\n";
	$headers .= "Organization: Claim Everything\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
	$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
	$headers .= "Content-Transfer-Encoding: binary";
	$headers .= "X-Priority: 3\r\n";
	$headers .= "X-Mailer: PHP" . phpversion() ."\r\n";
	
	echo '<p>Headers loaded...</p>';
	
	$to = 'austincaine@gmail.com'; 
    $subject = 'Website Email Test';
	
	// Set up email body
    $body = 'Email success!';
	
	echo '<p>Email loaded...</p>';
	
	// Send email
	if ($_POST) {
		
		echo '<p>Sending...</p>';
		
		if (mail ($to, $subject, $body, $headers)) { 
			echo '<p>Success!</p>';
		} else { 
			echo '<p>Error.</p>'; 
		}
		
		echo '<p>Sequence complete.</p>';
	}
?>